package com.twu.biblioteca.library;

import java.util.ArrayList;

public class Users {
    private ArrayList<User> users = new ArrayList<User>();

    public Users() {
        users.add(new User("111-1111", "user name", "password", "email", "phone number"));
    }

    public void setAllUers(ArrayList<User> users) {
        this.users = users;
    }

    public boolean validateUser(String libraryNumber, String password) {
        for (User user : users) {
            if (user.isSameUser(libraryNumber, password)) {
                return true;
            }
        }
        return false;
    }

    public String getUserInfo(String libraryNumber) {
        String userInfo = null;
        for (User user : users) {
            if (user.isLibNumberEquals(libraryNumber)) {
                userInfo = user.getUserInfo();
            }
        }
        return userInfo;
    }
}
